import java.util.Scanner;

//求斐波那契数列的第n项。(迭代实现)
public class TextDemo {
    public static int fib(int n){

        /*if(n==1||n==2){
            return 1;
        }else {
            return fib(n-1)+fib(n-2);
        }*/
        if (n == 1) {
            return 0;
        }
        if (n == 2) {
            return 1;
        }
        int f1 = 0;
        int f2 = 1;
        int f3 = 0;
        for (int i = 2;i <= n;i++) {
            f3 = f1+ f2;
            //更新中间状态
            f1 = f2;
            f2 = f3;
        }
        return f3;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ret=fib(n);
        System.out.println(ret);
    }
}
